<script setup lang="ts">
import { ref } from 'vue';
import { getPolicyAPI } from '@/api/user'
import { Toast } from 'vant';
    const state = ref({
        htmlText: ''
    })
    // 点击返回
    const onClickLeft = () => history.back();
    // 获取协议
    const getPolicy = async() => {
        const res = await getPolicyAPI({
            id:16
        })
        if (res) {
            state.value.htmlText = res.records[0].content
        }else{
            Toast(res.msg)
        }
    }
    getPolicy()
</script>


<template>
    <van-nav-bar
        title="隐私协议"
        left-text=""
        left-arrow
        @click-left="onClickLeft"
    />
    <div class="text-agree" v-html="state.htmlText"></div>

</template>

<style scoped>
.text-agree {
    padding: 0.5rem 0.7rem;
}
</style>